package org.openzip.openzip.unpacking.view.swing;

import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.filechooser.FileSystemView;

import org.openzip.openzip.gui.util.ObserverThreestateCheckBox;
/**
 * 
 * DO NOT USE!
* A kind of hack is used to create and paint the checkbox. In order to
* display both the file icon and the file name, the checkbox is created
* without the text label. A new label (instance of <code>JLabel</code>) is
* then created with the label and the file name. Because the
* <code>FileCheckBox</code> is a child of <code>JCheckBox</code>, which is a
* child of <code>JComponent</code> and it is a child of
* <code>Container</code>, the label is then added to the checkbox. The label
* has to be moved right by rougly 15 pixels, or it gets painted over the
* checkbox.
*/
public class ZipEntryCheckBox extends ObserverThreestateCheckBox {
	
	private ZipEntryFile zip;
	
	public ZipEntryCheckBox(ZipEntryFile zip) {
		super();
		this.zip = zip;
		
		String text = zip.getName();
		JLabel label = new JLabel(text);

		label.setBorder(BorderFactory.createEmptyBorder(0, 16, 0, 0));
		
		add(label);
	}
			
	public ZipEntryFile getZipEntry() {
		return this.zip;
	}
		

}
